﻿using System;
using Gp.Scripts.Equip;
using UnityEngine;

namespace Gp.Scripts.Core {
    public enum DamageType {
        Physic,
        Heat,
        Electric,
        Acid,
        Basicity,
        Pollution,
    }


    public struct DamageInfo {
        public DamageType Type;
        public int Num;

        public DamageInfo(int num) {
            Type = DamageType.Physic;
            Num = Mathf.Max(0, num);
        }

        public DamageInfo(int num, DamageType type) {
            Type = type;
            Num = num;
        }
    }


    public class ArmorDamageInfo {
        public ArmorFragmentEntity ArmorFragment;
        public int Damage;

        public ArmorDamageInfo(ArmorFragmentEntity armorFragment, int damage) {
            ArmorFragment = armorFragment;
            Damage = Math.Min(damage, armorFragment.CurDurability);
        }


        public void ExecuteDamage() {
            ArmorFragment.Damage(Damage);
        }
    }
}